#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
@desc: .

@Project ：kuberCloudTest 
@File ：async_task.py
@Author ：admin
@Date ：2024/3/21 11:28 
"""
from kuberCloudTest.common.basic import basicUtils


class asyncTaskUtils(basicUtils):

    def __init__(self, accessToken):
        super().__init__(accessToken)


def getAsyncTaskResult(accessToken, taskUri):
    """
    获取异步任务结果
    :param accessToken: access token
    :param taskUri:
    :return: {
                "actionResult":1,
                "clientIp":"192.168.12.34",
                "code":1,
                "createTime":1653989195000,
                "endTime":1653989196000,
                "id":"8ac187706f2b4ccbaf2df4aaaae914e4",
                "opType":1025,
                "resourceIds":["1005863a386a49df96c19d04c6606d7c"],
                "returnResult":"\"success\"",
                "usedTime":"1.00"
            }
        actionResult: async task processing results
                        1: success; 2: processing; 3: timeout; 0|-1: error
        returnResult: async task processing msg return
        code: get async task result http-request code
    """
    return asyncTaskUtils(accessToken=accessToken).cloud_http_request.get(taskUri)
